﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Weka
{
    internal abstract class FieldSerialiserProvider<T>
    {
        public FieldInfo FieldInfo { get; set; }
        public abstract FieldSerialiser<T> CreateFieldSerialiser();
    }


    internal abstract class FieldSerialiserProvider<T, T2> : FieldSerialiserProvider<T>
    {
        public Func<T, T2> Reader { get; set; }
    }



    internal abstract class FieldSerialiser<T>
    {
        public FieldInfo FieldInfo { get; set; }
        public abstract void ReadValueFromTAndWriteHeader(T value, StreamWrita streamWriter);
        public abstract void WriteValue(StreamWrita streamWriter);

        public virtual void WriteMetadata(StreamWrita sw)
        {
            sw.Write(FieldInfo);
        }
    }

    internal abstract class FieldSerialiser<T, T2> : FieldSerialiser<T>
    {
        public Func<T, T2> Reader { get; set; }
    }

}
